\(\int (a+b \sec (c+d x))^2 \tan ^7(c+d x) \, dx\) [272]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 21, antiderivative size = 149 \[ \int (a+b \sec (c+d x))^2 \tan ^7(c+d x) \, dx=\frac {a^2 \log (\cos (c+d x))}{d}-\frac {2 a b \sec (c+d x)}{d}+\frac {3 a^2 \sec ^2(c+d x)}{2 d}+\frac {2 a b \sec ^3(c+d x)}{d}-\frac {3 a^2 \sec ^4(c+d x)}{4 d}-\frac {6 a b \sec ^5(c+d x)}{5 d}+\frac {a^2 \sec ^6(c+d x)}{6 d}+\frac {2 a b \sec ^7(c+d x)}{7 d}+\frac {b^2 \tan ^8(c+d x)}{8 d} \]

[Out]

a^2*ln(cos(d*x+c))/d-2*a*b*sec(d*x+c)/d+3/2*a^2*sec(d*x+c)^2/d+2*a*b*sec(d*x+c)^3/d-3/4*a^2*sec(d*x+c)^4/d-6/5
*a*b*sec(d*x+c)^5/d+1/6*a^2*sec(d*x+c)^6/d+2/7*a*b*sec(d*x+c)^7/d+1/8*b^2*tan(d*x+c)^8/d

Rubi [A] (verified)

Time = 0.14 (sec) , antiderivative size = 169, normalized size of antiderivative = 1.13, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {3970, 962} \[ \int (a+b \sec (c+d x))^2 \tan ^7(c+d x) \, dx=\frac {\left (a^2-3 b^2\right ) \sec ^6(c+d x)}{6 d}-\frac {3 \left (a^2-b^2\right ) \sec ^4(c+d x)}{4 d}+\frac {\left (3 a^2-b^2\right ) \sec ^2(c+d x)}{2 d}+\frac {a^2 \log (\cos (c+d x))}{d}+\frac {2 a b \sec ^7(c+d x)}{7 d}-\frac {6 a b \sec ^5(c+d x)}{5 d}+\frac {2 a b \sec ^3(c+d x)}{d}-\frac {2 a b \sec (c+d x)}{d}+\frac {b^2 \sec ^8(c+d x)}{8 d} \]

[In]

Int[(a + b*Sec[c + d*x])^2*Tan[c + d*x]^7,x]

[Out]

(a^2*Log[Cos[c + d*x]])/d - (2*a*b*Sec[c + d*x])/d + ((3*a^2 - b^2)*Sec[c + d*x]^2)/(2*d) + (2*a*b*Sec[c + d*x
]^3)/d - (3*(a^2 - b^2)*Sec[c + d*x]^4)/(4*d) - (6*a*b*Sec[c + d*x]^5)/(5*d) + ((a^2 - 3*b^2)*Sec[c + d*x]^6)/
(6*d) + (2*a*b*Sec[c + d*x]^7)/(7*d) + (b^2*Sec[c + d*x]^8)/(8*d)

Rule 962

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIn
tegrand[(d + e*x)^m*(f + g*x)^n*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[e*f - d*g, 0] &&
NeQ[c*d^2 + a*e^2, 0] && IGtQ[p, 0] && (IGtQ[m, 0] || (EqQ[m, -2] && EqQ[p, 1] && EqQ[d, 0]))

Rule 3970

Int[cot[(c_.) + (d_.)*(x_)]^(m_.)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> Dist[-(-1)^((m - 1
)/2)/(d*b^(m - 1)), Subst[Int[(b^2 - x^2)^((m - 1)/2)*((a + x)^n/x), x], x, b*Csc[c + d*x]], x] /; FreeQ[{a, b
, c, d, n}, x] && IntegerQ[(m - 1)/2] && NeQ[a^2 - b^2, 0]

Rubi steps \begin{align*} \text {integral}& = -\frac {\text {Subst}\left (\int \frac {(a+x)^2 \left (b^2-x^2\right )^3}{x} \, dx,x,b \sec (c+d x)\right )}{b^6 d} \\ & = -\frac {\text {Subst}\left (\int \left (2 a b^6+\frac {a^2 b^6}{x}-b^4 \left (3 a^2-b^2\right ) x-6 a b^4 x^2+3 b^2 \left (a^2-b^2\right ) x^3+6 a b^2 x^4-\left (a^2-3 b^2\right ) x^5-2 a x^6-x^7\right ) \, dx,x,b \sec (c+d x)\right )}{b^6 d} \\ & = \frac {a^2 \log (\cos (c+d x))}{d}-\frac {2 a b \sec (c+d x)}{d}+\frac {\left (3 a^2-b^2\right ) \sec ^2(c+d x)}{2 d}+\frac {2 a b \sec ^3(c+d x)}{d}-\frac {3 \left (a^2-b^2\right ) \sec ^4(c+d x)}{4 d}-\frac {6 a b \sec ^5(c+d x)}{5 d}+\frac {\left (a^2-3 b^2\right ) \sec ^6(c+d x)}{6 d}+\frac {2 a b \sec ^7(c+d x)}{7 d}+\frac {b^2 \sec ^8(c+d x)}{8 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.67 (sec) , antiderivative size = 138, normalized size of antiderivative = 0.93 \[ \int (a+b \sec (c+d x))^2 \tan ^7(c+d x) \, dx=\frac {840 a^2 \log (\cos (c+d x))-1680 a b \sec (c+d x)+420 \left (3 a^2-b^2\right ) \sec ^2(c+d x)+1680 a b \sec ^3(c+d x)-630 \left (a^2-b^2\right ) \sec ^4(c+d x)-1008 a b \sec ^5(c+d x)+140 \left (a^2-3 b^2\right ) \sec ^6(c+d x)+240 a b \sec ^7(c+d x)+105 b^2 \sec ^8(c+d x)}{840 d} \]

[In]

Integrate[(a + b*Sec[c + d*x])^2*Tan[c + d*x]^7,x]

[Out]

(840*a^2*Log[Cos[c + d*x]] - 1680*a*b*Sec[c + d*x] + 420*(3*a^2 - b^2)*Sec[c + d*x]^2 + 1680*a*b*Sec[c + d*x]^
3 - 630*(a^2 - b^2)*Sec[c + d*x]^4 - 1008*a*b*Sec[c + d*x]^5 + 140*(a^2 - 3*b^2)*Sec[c + d*x]^6 + 240*a*b*Sec[
c + d*x]^7 + 105*b^2*Sec[c + d*x]^8)/(840*d)

Maple [A] (verified)

Time = 3.74 (sec) , antiderivative size = 113, normalized size of antiderivative = 0.76

method result size
parts \(\frac {a^{2} \left (\frac {\tan \left (d x +c \right )^{6}}{6}-\frac {\tan \left (d x +c \right )^{4}}{4}+\frac {\tan \left (d x +c \right )^{2}}{2}-\frac {\ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2}\right )}{d}+\frac {b^{2} \tan \left (d x +c \right )^{8}}{8 d}+\frac {2 a b \left (\frac {\sec \left (d x +c \right )^{7}}{7}-\frac {3 \sec \left (d x +c \right )^{5}}{5}+\sec \left (d x +c \right )^{3}-\sec \left (d x +c \right )\right )}{d}\) \(113\)
derivativedivides \(\frac {\frac {b^{2} \sec \left (d x +c \right )^{8}}{8}+\frac {2 a b \sec \left (d x +c \right )^{7}}{7}+\frac {a^{2} \sec \left (d x +c \right )^{6}}{6}-\frac {b^{2} \sec \left (d x +c \right )^{6}}{2}-\frac {6 a b \sec \left (d x +c \right )^{5}}{5}-\frac {3 a^{2} \sec \left (d x +c \right )^{4}}{4}+\frac {3 b^{2} \sec \left (d x +c \right )^{4}}{4}+2 a b \sec \left (d x +c \right )^{3}+\frac {3 a^{2} \sec \left (d x +c \right )^{2}}{2}-\frac {\sec \left (d x +c \right )^{2} b^{2}}{2}-2 a b \sec \left (d x +c \right )-a^{2} \ln \left (\sec \left (d x +c \right )\right )}{d}\) \(155\)
default \(\frac {\frac {b^{2} \sec \left (d x +c \right )^{8}}{8}+\frac {2 a b \sec \left (d x +c \right )^{7}}{7}+\frac {a^{2} \sec \left (d x +c \right )^{6}}{6}-\frac {b^{2} \sec \left (d x +c \right )^{6}}{2}-\frac {6 a b \sec \left (d x +c \right )^{5}}{5}-\frac {3 a^{2} \sec \left (d x +c \right )^{4}}{4}+\frac {3 b^{2} \sec \left (d x +c \right )^{4}}{4}+2 a b \sec \left (d x +c \right )^{3}+\frac {3 a^{2} \sec \left (d x +c \right )^{2}}{2}-\frac {\sec \left (d x +c \right )^{2} b^{2}}{2}-2 a b \sec \left (d x +c \right )-a^{2} \ln \left (\sec \left (d x +c \right )\right )}{d}\) \(155\)
risch \(-i a^{2} x -\frac {2 i a^{2} c}{d}-\frac {2 \left (210 a b \,{\mathrm e}^{15 i \left (d x +c \right )}-315 a^{2} {\mathrm e}^{14 i \left (d x +c \right )}+105 b^{2} {\mathrm e}^{14 i \left (d x +c \right )}+630 a b \,{\mathrm e}^{13 i \left (d x +c \right )}-1260 a^{2} {\mathrm e}^{12 i \left (d x +c \right )}+2226 a b \,{\mathrm e}^{11 i \left (d x +c \right )}-2765 a^{2} {\mathrm e}^{10 i \left (d x +c \right )}+735 b^{2} {\mathrm e}^{10 i \left (d x +c \right )}+3078 a b \,{\mathrm e}^{9 i \left (d x +c \right )}-3640 a^{2} {\mathrm e}^{8 i \left (d x +c \right )}+3078 a b \,{\mathrm e}^{7 i \left (d x +c \right )}-2765 a^{2} {\mathrm e}^{6 i \left (d x +c \right )}+735 b^{2} {\mathrm e}^{6 i \left (d x +c \right )}+2226 a b \,{\mathrm e}^{5 i \left (d x +c \right )}-1260 a^{2} {\mathrm e}^{4 i \left (d x +c \right )}+630 a b \,{\mathrm e}^{3 i \left (d x +c \right )}-315 a^{2} {\mathrm e}^{2 i \left (d x +c \right )}+105 b^{2} {\mathrm e}^{2 i \left (d x +c \right )}+210 a b \,{\mathrm e}^{i \left (d x +c \right )}\right )}{105 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{8}}+\frac {a^{2} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}\) \(315\)

[In]

int((a+b*sec(d*x+c))^2*tan(d*x+c)^7,x,method=_RETURNVERBOSE)

[Out]

a^2/d*(1/6*tan(d*x+c)^6-1/4*tan(d*x+c)^4+1/2*tan(d*x+c)^2-1/2*ln(1+tan(d*x+c)^2))+1/8*b^2*tan(d*x+c)^8/d+2*a*b
/d*(1/7*sec(d*x+c)^7-3/5*sec(d*x+c)^5+sec(d*x+c)^3-sec(d*x+c))

Fricas [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 146, normalized size of antiderivative = 0.98 \[ \int (a+b \sec (c+d x))^2 \tan ^7(c+d x) \, dx=\frac {840 \, a^{2} \cos \left (d x + c\right )^{8} \log \left (-\cos \left (d x + c\right )\right ) - 1680 \, a b \cos \left (d x + c\right )^{7} + 1680 \, a b \cos \left (d x + c\right )^{5} + 420 \, {\left (3 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{6} - 1008 \, a b \cos \left (d x + c\right )^{3} - 630 \, {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{4} + 240 \, a b \cos \left (d x + c\right ) + 140 \, {\left (a^{2} - 3 \, b^{2}\right )} \cos \left (d x + c\right )^{2} + 105 \, b^{2}}{840 \, d \cos \left (d x + c\right )^{8}} \]

[In]

integrate((a+b*sec(d*x+c))^2*tan(d*x+c)^7,x, algorithm="fricas")

[Out]

1/840*(840*a^2*cos(d*x + c)^8*log(-cos(d*x + c)) - 1680*a*b*cos(d*x + c)^7 + 1680*a*b*cos(d*x + c)^5 + 420*(3*
a^2 - b^2)*cos(d*x + c)^6 - 1008*a*b*cos(d*x + c)^3 - 630*(a^2 - b^2)*cos(d*x + c)^4 + 240*a*b*cos(d*x + c) +
140*(a^2 - 3*b^2)*cos(d*x + c)^2 + 105*b^2)/(d*cos(d*x + c)^8)

Sympy [A] (verification not implemented)

Time = 1.49 (sec) , antiderivative size = 252, normalized size of antiderivative = 1.69 \[ \int (a+b \sec (c+d x))^2 \tan ^7(c+d x) \, dx=\begin {cases} - \frac {a^{2} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {a^{2} \tan ^{6}{\left (c + d x \right )}}{6 d} - \frac {a^{2} \tan ^{4}{\left (c + d x \right )}}{4 d} + \frac {a^{2} \tan ^{2}{\left (c + d x \right )}}{2 d} + \frac {2 a b \tan ^{6}{\left (c + d x \right )} \sec {\left (c + d x \right )}}{7 d} - \frac {12 a b \tan ^{4}{\left (c + d x \right )} \sec {\left (c + d x \right )}}{35 d} + \frac {16 a b \tan ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}}{35 d} - \frac {32 a b \sec {\left (c + d x \right )}}{35 d} + \frac {b^{2} \tan ^{6}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}}{8 d} - \frac {b^{2} \tan ^{4}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}}{8 d} + \frac {b^{2} \tan ^{2}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}}{8 d} - \frac {b^{2} \sec ^{2}{\left (c + d x \right )}}{8 d} & \text {for}\: d \neq 0 \\x \left (a + b \sec {\left (c \right )}\right )^{2} \tan ^{7}{\left (c \right )} & \text {otherwise} \end {cases} \]

[In]

integrate((a+b*sec(d*x+c))**2*tan(d*x+c)**7,x)

[Out]

Piecewise((-a**2*log(tan(c + d*x)**2 + 1)/(2*d) + a**2*tan(c + d*x)**6/(6*d) - a**2*tan(c + d*x)**4/(4*d) + a*
*2*tan(c + d*x)**2/(2*d) + 2*a*b*tan(c + d*x)**6*sec(c + d*x)/(7*d) - 12*a*b*tan(c + d*x)**4*sec(c + d*x)/(35*
d) + 16*a*b*tan(c + d*x)**2*sec(c + d*x)/(35*d) - 32*a*b*sec(c + d*x)/(35*d) + b**2*tan(c + d*x)**6*sec(c + d*
x)**2/(8*d) - b**2*tan(c + d*x)**4*sec(c + d*x)**2/(8*d) + b**2*tan(c + d*x)**2*sec(c + d*x)**2/(8*d) - b**2*s
ec(c + d*x)**2/(8*d), Ne(d, 0)), (x*(a + b*sec(c))**2*tan(c)**7, True))

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 139, normalized size of antiderivative = 0.93 \[ \int (a+b \sec (c+d x))^2 \tan ^7(c+d x) \, dx=\frac {840 \, a^{2} \log \left (\cos \left (d x + c\right )\right ) - \frac {1680 \, a b \cos \left (d x + c\right )^{7} - 1680 \, a b \cos \left (d x + c\right )^{5} - 420 \, {\left (3 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{6} + 1008 \, a b \cos \left (d x + c\right )^{3} + 630 \, {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{4} - 240 \, a b \cos \left (d x + c\right ) - 140 \, {\left (a^{2} - 3 \, b^{2}\right )} \cos \left (d x + c\right )^{2} - 105 \, b^{2}}{\cos \left (d x + c\right )^{8}}}{840 \, d} \]

[In]

integrate((a+b*sec(d*x+c))^2*tan(d*x+c)^7,x, algorithm="maxima")

[Out]

1/840*(840*a^2*log(cos(d*x + c)) - (1680*a*b*cos(d*x + c)^7 - 1680*a*b*cos(d*x + c)^5 - 420*(3*a^2 - b^2)*cos(
d*x + c)^6 + 1008*a*b*cos(d*x + c)^3 + 630*(a^2 - b^2)*cos(d*x + c)^4 - 240*a*b*cos(d*x + c) - 140*(a^2 - 3*b^
2)*cos(d*x + c)^2 - 105*b^2)/cos(d*x + c)^8)/d

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 415 vs. \(2 (137) = 274\).

Time = 3.31 (sec) , antiderivative size = 415, normalized size of antiderivative = 2.79 \[ \int (a+b \sec (c+d x))^2 \tan ^7(c+d x) \, dx=-\frac {840 \, a^{2} \log \left ({\left | -\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 1 \right |}\right ) - 840 \, a^{2} \log \left ({\left | -\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} - 1 \right |}\right ) + \frac {2283 \, a^{2} + 1536 \, a b + \frac {19944 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {12288 \, a b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {77364 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {43008 \, a b {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {175448 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {86016 \, a b {\left (\cos \left (d x + c\right ) - 1\right )}^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {231490 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} + \frac {53760 \, a b {\left (\cos \left (d x + c\right ) - 1\right )}^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} - \frac {26880 \, b^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} + \frac {175448 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} + \frac {77364 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{6}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{6}} + \frac {19944 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{7}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{7}} + \frac {2283 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{8}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{8}}}{{\left (\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 1\right )}^{8}}}{840 \, d} \]

[In]

integrate((a+b*sec(d*x+c))^2*tan(d*x+c)^7,x, algorithm="giac")

[Out]

-1/840*(840*a^2*log(abs(-(cos(d*x + c) - 1)/(cos(d*x + c) + 1) + 1)) - 840*a^2*log(abs(-(cos(d*x + c) - 1)/(co
s(d*x + c) + 1) - 1)) + (2283*a^2 + 1536*a*b + 19944*a^2*(cos(d*x + c) - 1)/(cos(d*x + c) + 1) + 12288*a*b*(co
s(d*x + c) - 1)/(cos(d*x + c) + 1) + 77364*a^2*(cos(d*x + c) - 1)^2/(cos(d*x + c) + 1)^2 + 43008*a*b*(cos(d*x
+ c) - 1)^2/(cos(d*x + c) + 1)^2 + 175448*a^2*(cos(d*x + c) - 1)^3/(cos(d*x + c) + 1)^3 + 86016*a*b*(cos(d*x +
 c) - 1)^3/(cos(d*x + c) + 1)^3 + 231490*a^2*(cos(d*x + c) - 1)^4/(cos(d*x + c) + 1)^4 + 53760*a*b*(cos(d*x +
c) - 1)^4/(cos(d*x + c) + 1)^4 - 26880*b^2*(cos(d*x + c) - 1)^4/(cos(d*x + c) + 1)^4 + 175448*a^2*(cos(d*x + c
) - 1)^5/(cos(d*x + c) + 1)^5 + 77364*a^2*(cos(d*x + c) - 1)^6/(cos(d*x + c) + 1)^6 + 19944*a^2*(cos(d*x + c)
- 1)^7/(cos(d*x + c) + 1)^7 + 2283*a^2*(cos(d*x + c) - 1)^8/(cos(d*x + c) + 1)^8)/((cos(d*x + c) - 1)/(cos(d*x
 + c) + 1) + 1)^8)/d

Mupad [B] (verification not implemented)

Time = 17.89 (sec) , antiderivative size = 280, normalized size of antiderivative = 1.88 \[ \int (a+b \sec (c+d x))^2 \tan ^7(c+d x) \, dx=-\frac {\frac {64\,a\,b}{35}+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (16\,a^2+\frac {256\,b\,a}{5}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (2\,a^2+\frac {512\,b\,a}{35}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (\frac {170\,a^2}{3}+\frac {512\,b\,a}{5}\right )-\frac {170\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}}{3}+16\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}-2\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{14}+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8\,\left (\frac {256\,a^2}{3}+64\,a\,b-32\,b^2\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{16}-8\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{14}+28\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}-56\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+70\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-56\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+28\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-8\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}-\frac {2\,a^2\,\mathrm {atanh}\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\right )}{d} \]

[In]

int(tan(c + d*x)^7*(a + b/cos(c + d*x))^2,x)

[Out]

- ((64*a*b)/35 + tan(c/2 + (d*x)/2)^4*((256*a*b)/5 + 16*a^2) - tan(c/2 + (d*x)/2)^2*((512*a*b)/35 + 2*a^2) - t
an(c/2 + (d*x)/2)^6*((512*a*b)/5 + (170*a^2)/3) - (170*a^2*tan(c/2 + (d*x)/2)^10)/3 + 16*a^2*tan(c/2 + (d*x)/2
)^12 - 2*a^2*tan(c/2 + (d*x)/2)^14 + tan(c/2 + (d*x)/2)^8*(64*a*b + (256*a^2)/3 - 32*b^2))/(d*(28*tan(c/2 + (d
*x)/2)^4 - 8*tan(c/2 + (d*x)/2)^2 - 56*tan(c/2 + (d*x)/2)^6 + 70*tan(c/2 + (d*x)/2)^8 - 56*tan(c/2 + (d*x)/2)^
10 + 28*tan(c/2 + (d*x)/2)^12 - 8*tan(c/2 + (d*x)/2)^14 + tan(c/2 + (d*x)/2)^16 + 1)) - (2*a^2*atanh(tan(c/2 +
 (d*x)/2)^2))/d